#ifndef CAPTCHASOLVER_H
#define CAPTCHASOLVER_H

#include <QString>
#include <QList>
#include <QTcpServer>
#include <QTcpSocket>
#include "captchas/captchadesc.h"
#include "clientsocket.h"

class CaptchaSolver:public QObject
{
    Q_OBJECT

    CaptchaSolver();
    static CaptchaSolver *instance;

    QMap<int, CaptchaDesc*> list;
    QList<ClientSocket*> cliList;
    QTcpServer* server;
    void send(QTcpSocket*, CaptchaDesc*);
public:
    static CaptchaSolver *getInstance();
    int solve(QString);
    CaptchaDesc* getCaptchaDesc(int);
    void rmCaptchaDesc(int);
    ~CaptchaSolver();
signals:
    void solved(int, QString);
public slots:
    void newConnection();
    void removeClient(ClientSocket*);
    void solvedSlot(int, QString);
    //void captchaAns();


};

#endif // CAPTCHASOLVER_H
